#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef struct {
    char id[5];
    int likes;
} UserLikes;

int compareUserLikes(const void *a, const void *b) {
    return strcmp(((UserLikes*)a)->id, ((UserLikes*)b)->id);
}

int main() {
    char followList[5000][5];
    int N;
    scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        scanf("%s", followList[i]);
    }

    int M;
    scanf("%d", &M);
    UserLikes likes[10000];
    for (int i = 0; i < M; i++) {
        scanf("%s %d", likes[i].id, &likes[i].likes);
    }
    qsort(likes, M, sizeof(UserLikes), compareUserLikes);

    int totalLikes = 0;
    for (int i = 0; i < M; i++) {
        totalLikes += likes[i].likes;
    }
    double avgLikes = (double)totalLikes / M;

    int found = 0;
    for (int i = 0; i < M; i++) {
        if (likes[i].likes > avgLikes) {
            int j;
            for (j = 0; j < N; j++) {
                if (strcmp(likes[i].id, followList[j]) == 0) {
                    break;
                }
            }
            if (j == N) {
                printf("%s\n", likes[i].id);
                found = 1;
            }
        }
    }

    if (!found) {
        printf("Bing Mei You\n");
    }

    return 0;
}